{% extends 'base.html' %}
{% block title %}添加{% endblock title %}

{% block content %}
    <div class="container">
        <div class="panel panel-default">
            <div class="panel-heading">
               <span class="glyphicon glyphicon-user" aria-hidden="true"></span>添加学生
            </div>

            <div class="panel-body">
                <form method="post">
                    {% csrf_token %}
                    {% for field in form %}
                        <div class="form-group">
                            <label>{{ field.label }}</label>
                        {{ field }}
                        <span style="color:red">{{ field.errors.0 }}</span>
                        </div>
                    {% endfor %}
                    <button type="submit" class="btn btn-primary">提交</button>
                </form>
            </div>
        </div>

    </div>

{% endblock %}

    <form method="post">
        {% csrf_token %}
        {% for field in form %}
        {{ field.label }} : {{ field }}
        {% endfor %}
    </form>